<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<p:dataTable var="promotion" value="#{promotionModel.list}" filteredValue="#{promotionModel.filteredList}" filterEvent="enter"
		rowKey="#{promotion.id}" selection="#{promotionModel.current}"
		selectionMode="single" paginator="true" rows="10"
		rowsPerPageTemplate="5,7,10,15,20,30,40,50"
		paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">

		<p:ajax event="rowSelect" update=":detailForm,:headerForm"
			listener="#{promotionController.onRowSelect}"></p:ajax>
		<p:column headerText="id" sortBy="#{promotion.id}"
			filterBy="#{promotion.id}" filterMatchMode="contains">
			<h:outputText value="#{promotion.id}" />
		</p:column>


		<p:column headerText="Title" sortBy="#{promotion.titleLabel}"
			filterBy="#{promotion.titleLabel}" filterMatchMode="contains">
			<h:outputText value="#{promotion.titleLabel}" />
		</p:column>
		<p:column headerText="Start" sortBy="#{promotion.startDate}"
			filterBy="#{promotion.startDate}" filterMatchMode="contains">
			<h:outputText value="#{promotion.startDate}" />
		</p:column>
		<p:column headerText="End" sortBy="#{promotion.endDate}"
			filterBy="#{promotion.endDate}" filterMatchMode="contains">
			<h:outputText value="#{promotion.endDate}" />
		</p:column>

		<p:column headerText="Reward rate" sortBy="#{promotion.rewardRate}"
			filterBy="#{promotion.rewardRate}" filterMatchMode="contains">
			<h:outputText value="#{promotion.rewardRate}" />
		</p:column>
		<p:column headerText="Min amount" sortBy="#{promotion.minAmount}"
			filterBy="#{promotion.minAmount}" filterMatchMode="contains">
			<h:outputText value="#{promotion.minAmount}" />
		</p:column>
		<p:column headerText="Marketing Media"
			sortBy="#{promotion.marketingMedia}"
			filterBy="#{promotion.marketingMedia}" filterMatchMode="contains">
			<h:outputText value="#{promotion.marketingMedia}" />
		</p:column>

	</p:dataTable>
</ui:composition>
</html>